package com.concerneyes.mine.adapter.serviceCentre;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.concerneyes.R;

/**
 * Created by Administrator on 2017/6/21 0021.
 */

public class CheckLogAdapter extends BaseAdapter {
    private int[] listIcon;
    private Context context;


    public CheckLogAdapter(Context context) {
        this.context = context;
        listIcon = new int[]{R.drawable.default_header, R.drawable.default_header, R.drawable.default_header, R.drawable.default_header, R.drawable.default_header, R.drawable.default_header, R.drawable.ic_checked};
    }

    @Override
    public int getCount() {
        return 7;
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder holder;
        if (convertView == null) {
            holder = new ViewHolder();
            convertView = LayoutInflater.from(context).inflate(R.layout.item_check_log, null);
            holder.ivGlasses = (ImageView) convertView.findViewById(R.id.iv_glasses);
            holder.tvGoodsName = (TextView) convertView.findViewById(R.id.tv_goods_name);
            holder.logStyle = (TextView) convertView.findViewById(R.id.log_style);
            holder.logTransport = (TextView) convertView.findViewById(R.id.log_transport);
            holder.logNum = (TextView) convertView.findViewById(R.id.log_num);
            convertView.setTag(holder);
        } else {
            holder = (ViewHolder) convertView.getTag();
        }
        holder.ivGlasses.setImageResource(listIcon[position]);
        holder.tvGoodsName.setText("康爱斯00"+position+"#");
        holder.logStyle.setText("已发货");
        holder.logTransport.setText("顺丰快递");
        holder.logNum.setText("00000000251565616516516");
        return convertView;
    }

    class ViewHolder {
        ImageView ivGlasses;
        TextView tvGoodsName;
        TextView logStyle;
        TextView logTransport;
        TextView logNum;
    }
}
